package com.itheima.demo05.Collections;

import java.util.ArrayList;
import java.util.Collections;

public class Demo02Sort {
    public static void main(String[] args) {
        ArrayList<Integer> list01 = new ArrayList<>();
        Collections.addAll(list01, 1, 3, 2);
        Collections.sort(list01);
        System.out.println(list01);
        ArrayList<Person> list02 = new ArrayList<>();
        list02.add(new Person("张三", 18));
        list02.add(new Person("李四", 20));
        list02.add(new Person("王五", 15));
        System.out.println(list02);
        Collections.sort(list02);
        System.out.println(list02);
    }
}
